<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<style>
.td_item {height:30px; line-height: 30px; width: 100%;   vertical-align: middle; margin:0px; padding:0px 0px 0px 0px; overflow: hidden;border-top:solid 1px #b7d1e6;}
.checkboxWidth{width:200px;}
.td_item_span{display:block ;text-align: center;width: 71% !important;}
</style>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<c:set var="grant_code"><x:out select="$xmlData/data/proposal/grant_code" /></c:set>
<c:set var="sub_grant_code"><x:out select="$xmlData/data/proposal/sub_grant_code" /></c:set>
<c:set var="nature_value"><x:out select="$xmlData/data/organizations/organization[@submit_org='1']/nature_value" /> </c:set>

<c:if test="${grant_code==635}">
	<!-- 635国家基础科学人才培养基金 -->
	<c:set var="disabledClass">class="gray" disabled</c:set>
</c:if>

<div class="t_bar">单位财务情况（单位：万元）</div>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="t_css" id="finances">
	        <tr class="t_tr">
	          <td align="center" width="20%">指标</td>
	          <td align="center" width="27%">大前年度（${year-3 }）年</td>
	          <td align="center" width="27%">前年度（${year-2 }）年</td>
	          <td align="center" width="27%">上年度（${year-1 }）年</td>
       	</tr>
      	<!-- 企业财务 -->
<c:set var="finance_items"
		value="&nbsp;&nbsp;营业（销售）收入,&nbsp;&nbsp;主营业务收入,&nbsp;&nbsp;主营业务收入增长率（%）,&nbsp;&nbsp;新产品销售收入,&nbsp;&nbsp;出口总额(万美元),&nbsp;&nbsp;利润总额,&nbsp;&nbsp;主营业务利润,&nbsp;&nbsp;净利润,&nbsp;&nbsp;纳税总额,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;其中，增值税,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;其中，营业税,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;其中，企业所得税,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;其中，个人所得税,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;其中，其他税,&nbsp;&nbsp;研发经费支出总额,&nbsp;&nbsp;研发经费占销售收入比例（%）,&nbsp;&nbsp;年末资产总额,&nbsp;&nbsp;其中：年末固定资产净值,&nbsp;&nbsp;年负债总额,&nbsp;&nbsp;资产负债率（%）,&nbsp;&nbsp;经营活动现金流量净额,&nbsp;&nbsp;经营活动现金流入总额,&nbsp;&nbsp;经营活动现金流出总额"
		scope="page"></c:set>       <c:if test="${fn:substring(nature_value,0,1)=='A' }">
       	<tr class="li_1" id="finance_enterprise" >
        	<td style="padding:0px">
        		<c:forEach items="${fn:split(finance_items, ',') }" var="item" varStatus="sta">
        			<div class="td_item" <c:if test="${sta.index%2!=0 }">style="background:#f1f1f1;"</c:if>>${item }</div>
        		</c:forEach>
        	</td>
        	<c:set value="1" var="index" scope="page" />
			<x:forEach select="$xmlData/data/organization/finances/finance" var="finance" varStatus="finSta">
			<c:if test="${finSta.index>0 }">
			<c:set var="finance_type"><x:out select="$finance/@type" /></c:set>
				<c:if test="${index==1||index==2||index==4 }">
	        	<td style="border-left: 1px solid #FFF;">
	        		<c:choose>
	        			<c:when test="${index==1 }"><input type="hidden" name="organization/finances/finance[${index }]@year" value="${year-3 }" /></c:when>
	        			<c:when test="${index==2 }"><input type="hidden" name="organization/finances/finance[${index }]@year" value="${year-2 }" /></c:when>
	        			<c:when test="${index==4 }"><input type="hidden" name="organization/finances/finance[${index }]@year" value="${year-1 }" /></c:when>
	        		</c:choose>
        			<input type="hidden" name="organization/finances/finance[${index }]@sequence_no" value="${index+1 }" />
        			<input type="hidden" name="organization/finances/finance[${index }]@type" value="企业财务" />
        			<div class="td_item" align="center"><x:out select="$finance/income" /></div>
        			<div class="td_item" align="center"><x:out select="$finance/income_main" /></div>
        			<div class="td_item" align="center"><x:out select="$finance/increase" /></div>
        			<div class="td_item" align="center"><x:out select="$finance/income_sale" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/export" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/proft_total" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/proft_main" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/proft" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/fax" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/fax_added" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/fax_bussiness" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/fax_income" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/fax_personal" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/fax_other" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/yanfa_income" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/yanfa_income_pre" /></div>
	        		
	        		<div class="td_item" align="center"><x:out select="$finance/assets" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/assets_fixed" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/liabilities" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/liabilities_pre" /></div>
	        		<%-- <div class="td_item" align="center"><x:out select="$finance/caseflow" /></div> --%>
	        		<div class="td_item" align="center"><x:out select="$finance/caseflow_active" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/caseflow_active_in" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/caseflow_active_out" /></div>
	        	</td>
        		</c:if>
        		
        		<c:set value="${index+1 }" var="index" scope="page" />
        	</c:if>
        	</x:forEach>
			
			
        </tr>
      
        </c:if>
      	<!-- 事业财务 -->
      	<c:set var="finance_items" 
      	value="&nbsp;&nbsp;年度总收入,
      	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.生产经营收入,
      	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.科技活动收入,
      	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.其他收入,
      	&nbsp;&nbsp;年度总收入增长率(%),
      	&nbsp;&nbsp;年度总支出,
      	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.生产经营支出,
      	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.科技活动支出,
      	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.其他支出,
      	&nbsp;&nbsp;年末资产总额,
      	&nbsp;&nbsp;年末固定资产原值,
      	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.年末科研用房原值,
      	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.年末科研设备原值,
      	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.其他固定资产原值,
      	&nbsp;&nbsp;固定资产增长率(%),
      	&nbsp;&nbsp;科研设备资产增长率(%),
      	&nbsp;&nbsp;年末负债总额" 
      	scope="page"></c:set>
      
        <tr class="li_1" id="finance_career" <c:if test="${fn:substring(nature_value,0,1)=='A' }">style="display:none"</c:if>>
        	<td style="padding:0px">
        		<c:forEach items="${fn:split(finance_items, ',') }" var="item" varStatus="sta">
        			<div class="td_item" <c:if test="${sta.index%2!=0 }">style="background:#f1f1f1;"</c:if>>${item }</div>
        		</c:forEach>
        	</td>
        	<c:set value="0" var="index" scope="page" />
			<x:forEach select="$xmlData/data/organization/finances/finance" var="finance">
			<c:set var="finance_type"><x:out select="$finance/@type" /></c:set>
				<c:if test="${index==1||index==2||index==4 }">
	        	<td style="border-left: 1px solid #FFF;">
	        		<c:choose>
	        			<c:when test="${index==1 }"><input type="hidden" name="organization/finances/finance[${index }]@year" value="${year_3 }" /></c:when>
	        			<c:when test="${index==2 }"><input type="hidden" name="organization/finances/finance[${index }]@year" value="${year_2 }" /></c:when>
	        			<c:when test="${index==4 }"><input type="hidden" name="organization/finances/finance[${index }]@year" value="${year_1 }" /></c:when>
	        		</c:choose>
        			<input type="hidden" name="organization/finances/finance[${index }]@sequence_no" value="${index+1 }" />
        			<input type="hidden" name="organization/finances/finance[${index }]@type" value="事业财务" />
        			<div class="td_item" align="center"><x:out select="$finance/income" /></div>
        			<div class="td_item" align="center"><x:out select="$finance/income_product" /></div>
        			<div class="td_item" align="center"><x:out select="$finance/income_tech" /></div>
        			<div class="td_item" align="center"><x:out select="$finance/income_other" /></div>
        			<div class="td_item" align="center"><x:out select="$finance/income_rate" /></div>
        			<div class="td_item" align="center"><x:out select="$finance/outcome" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/outcome_product" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/outcome_tech" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/outcome_other" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/assets" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/assets_fixed" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/assets_fixed_room" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/assets_fixed_equiment" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/assets_fixed_other" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/assets_fixed_rate" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/assets_fixed_equiment_rate" /></div>
	        		<div class="td_item" align="center"><x:out select="$finance/liabilities" /></div>
	        	</td>
        		</c:if>
				
        		<c:set value="${index+1 }" var="index" scope="page" />
			</x:forEach>
			
	        </tr>
		</table>
		
<br>    
<div class="t_bar">主要产品情况</div>
<table class="t_css" width="100%" border="0" cellpadding="0"
	id="tblProduct" cellspacing="1">
	<thead>
		<tr>
			<th class="TblHead" align="center" width="10%" nowrap>序号</th>
			<th class="TblHead" align="center" width="40%" nowrap>主要产品名称</th>
			<th class="TblHead" align="center" width="20%" nowrap>是否具有自主知识产权</th>
			<th class="TblHead" align="center" width="10%" nowrap>产品类型</th>
			<th class="TblHead" align="center" width="20%" nowrap>占企业销售收入总额比例（%）</th>
		</tr>
	</thead>
	<tbody id="tab">
	<c:set value="0" var="index" scope="page" />
		<x:forEach select="$xmlData/data/product/goods" var="goods">
			<c:choose>
				<c:when test="${index<10}">
					<c:set value="0" var="flag" scope="page" />
				</c:when>
				<c:otherwise>
					<c:set value="" var="flag" scope="page" />
				</c:otherwise>
			</c:choose>
			<tr align="center">

				<td align="center" nowrap="nowrap"><span
					name="product/goods[${flag}${index}]@sequence_no"><x:out
							select="$goods/@sequence_no" /></span></td>
				<td align="center" nowrap="nowrap"><span
					name="product/goods[${flag}${index}]/gname"><x:out
							select="$goods/gname" /></span></td>
				<td align="center" nowrap="nowrap"><span
					name="product/goods[${flag}${index}]/is_property_right_name"><x:out
							select='$goods/is_property_right_name' /></span></td>
				<td align="center" nowrap="nowrap"><span
					name="product/goods[${flag}${index}]/goods_type_name"><x:out
							select='$goods/goods_type_name' /></span></td>

				<td align="center" nowrap="nowrap"><span
					name="product/goods[${flag}${index}]/percent"><x:out
							select="$goods/percent" /></span></td>
			</tr>
			<c:set value="${index+1}" var="index" scope="page" />
		</x:forEach>
	</tbody>
</table>


<br>
<div class="t_bar">
	上年度具有自主知识产权产品经营情况（单位：万元）
</div>
<table class="t_css" id='ftable1' width="100%" border="0"
	cellpadding="0" cellspacing="1">
	<tr>
		<td align="right" width="20%">产品销售收入：</td>
		<td align="center" width="27%"><span name="product/income"><x:out
					select="$xmlData/data/product/income" /></span></td>
		<td align="right" width="27%">净利润：</td>
		<td align="center" width="27%"><span name="product/profit"><x:out
					select="$xmlData/data/product/profit" /></span></td>
	</tr>
	<tr>
		<td align="right">纳税总额：</td>
		<td align="center"><span name="product/tax"><x:out
					select="$xmlData/data/product/tax" /></span></td>
		<td align="right">其中增值税总额：</td>
		<td align="center"><span name="product/added_tax"><x:out
					select="$xmlData/data/product/added_tax" /></span></td>
	</tr>
</table>

<script type="text/javascript">
	
	$("#finance_enterprise").children("td:not(:first)").each(function(){
		setFinanceStyle($(this));
	});
	
	$("#finance_career").children("td:not(:first)").each(function(){
		setFinanceStyle($(this));
	});
	
	/*
	 * 设置财务样式
	 */
	 function setFinanceStyle(obj) {
		obj.css("padding", "0").children("div:odd").css("background", "#f1f1f1");
		obj.find("input").css("width", 120).css("margin-top", "3px").css("height", "18px");
		obj.find("span").attr("style", "width: 95%; text-align: right; display: block;");
	 }
</script>
